const encrypt = require("../lib/encrypt");
const decrypt = require("../lib/decrypt");

require("should");

let symbolProp = Symbol("pwdCrypt#aesKey");

describe("password encrypt and decrypt methods test", () => {
	it("should compare ok", done => {
		let obj = {
			[symbolProp]: "pwdCrypto"
		};
		encrypt(symbolProp)
			.call(obj, "12345678")
			.then(str => {
				decrypt(symbolProp)
					.call(obj, "12345678", str)
					.then(val => {
						val.should.be.ok();
						done();
					});
			})
			.catch(err => {
				done(err);
			});
	});
});
